﻿@{
    var categories = new Sap.Repositories.CategoryRepository(new Sap.Contexts.DatabaseContext());
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - Sap</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/bundles/css")
</head>
<body>
    <div id="header">
        <div class="content-wrapper">
            <div id="header-left" class="float-left">
                <h1>@Html.ActionLink("Sap", "index", "home")</h1>
            </div>
            <div id="header-right" class="float-right">
                <div id="header-login" class="float-left">
                    @Html.Partial("_LoginPartial")
                </div>
                <div id="header-search" class="float-right">
                    <input id="search" name="search" type="text" value="Search.." />
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>

    <div id="sub-header" class="content-wrapper">
        <h1>@Html.ActionLink(ViewData["Title"].ToString(), "", "")</h1>
    </div>

    <div id="navigation" class="content-wrapper">
        <ul>
            <li>@Html.ActionLink("Home", "index", "home")</li>
            <li>@Html.ActionLink("About", "about", "home")</li>
            <li>@Html.ActionLink("Blog", "index", "blog")</li>
            @if (User.IsInRole("Administrator"))
            {
                <li>@Html.ActionLink("Admin", "index", "admin")</li>
            }
        </ul>
    </div>

    <div id="content" class="content-wrapper">
        <div id="content-left" class="float-left">
            @RenderBody()
        </div>
        <div id="content-right" class="float-right">
            <div class="content-right-part">
                <h2>Categories</h2>
                <ul>
                    @foreach (var category in categories.GetAll())
                    {
                        <li>@Html.ActionLink(category.Name, "", "") (@categories.GetPostPerCategory(category.Id))</li>
                    }
                </ul>
            </div>
        </div>
        <div class="clear"></div>
    </div>

    <div id="footer" class="content-wrapper">
        <p>Version 0.1</p>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/js")
    @RenderSection("Scripts", false)
</body>
</html>
